package com.xiaoyu.user;

import com.xiaoyu.common.conf.JsonUtil;

import java.util.Map;

/**
 * Comments：
 * Author：yuxin
 * Create Date：2017-04-06
 * Modified By：就是你
 * Modified Date：
 * Why & What is modified：
 * Version：v1.0
 */
/*得到url*/
public class read {
    public static void main(String[] args) {
        String str = "{  }";
        Map map1 = JsonUtil.toObject(str, Map.class);
        for (Object keys : map1.keySet()){
            String uri = keys.toString().substring(2, keys.toString().indexOf("]"));
            Integer start = uri.indexOf("{");
            Integer end = uri.indexOf("}");
            Integer start1=uri.indexOf("{",end);
            Integer end1=uri.indexOf("}",end+1);
            String tempStr = "";
            if (start > 0) {
                tempStr = uri.substring(start, end + 1);
                String uri1= uri.replace(tempStr, "*");
                if(start1<0){
                    System.out.println(uri1);
                }
                else {
                    String a1=uri.substring(start1,end1+1);
                    String uri2=uri1.replace(a1,"*");
                    System.out.println(uri2);
                }
            } else {
                System.out.println(uri);
            }
        }
    }
}
